function init(config) {
  return {
    getRoomShow(params) {
      console.log(params)
      const url = `${config.roomSystem}/game-lobby/Room/room/11111/2`
      const opt = {
        method: 'GET',
        headers: {
          Authorization: Cookies.get('token')
        }
      }
      return fetch(url, opt)
    },
    getAppId(params) {
      console.log('参数', params)
      const url = `${config.roomSystem}/game-lobby/wechat/share/info/${Cookies.get('areaCode')}`
      const opt = {
        method: 'POST',
        body: JSON.stringify(params),
        mode: 'cors',
        headers: {
          Authorization: Cookies.get('token'),
          'Content-Type': 'application/json',
        }
      }
      // console.log(opt)
      return fetch(url, opt)
    },
    getJiesan(params) {
      console.log(params)
      const url = `${config.roomSystem}/game-lobby/Room/room/dismiss/${params.roomNo}`
      const opt = {
        method: 'PUT',
        headers: {
          Authorization: Cookies.get('token')
        }
      }
      return fetch(url, opt)
    },
    getyichu(params) {
      console.log(params)
      const url = `${config.roomSystem}/game-lobby/Room/room/dismiss/${params.roomNo}`
      const opt = {
        method: 'PUT',
        headers: {
          Authorization: Cookies.get('token')
        }
      }
      return fetch(url, opt)
    },
    getYichu(params) {
      console.log(params)
      const url = `${config.roomSystem}/game-lobby/Room/room/delete/${params.roomNo}/${params.uid}`
      const opt = {
        method: 'PUT',
        headers: {
          Authorization: Cookies.get('token')
        }
      }
      return fetch(url, opt)
    },
  }
}

export default init